package com.project.ATM;

import java.util.Arrays;
import java.util.Scanner;

public class ATM_UI {

  public static int welcome() {
    Scanner sc = new Scanner(System.in);
    System.out.println("\t丨----Welcome to use ATM server----丨\t");
    System.out.println("\t丨选择所需业务:                      丨\t");
    System.out.println("\t丨 1.jpg、存款             5、查询余额    丨\t");
    System.out.println("\t丨 2、取款                          丨\t");
    System.out.println("\t丨 3、转账                          丨\t");
    System.out.println("\t丨 4、退出                          丨\t");
    System.out.println("\t丨---------------------------------丨\t");
    int operate = sc.nextInt();
    return operate;
  }

  public static void quit(){
    System.out.println("\t丨---------------------------------丨\t");
    System.out.println("\t丨        Thanks for use           丨\t");
    System.out.println("\t丨---------------------------------丨\t");
  }

  public static void Show_error_NointMoney(){
    System.out.println("\t丨----------   Status   -----------丨\t");
    System.out.println("\t丨              Error              丨\t");
    System.out.println("\t丨           必须为100的倍数         丨\t");
    System.out.println("\t丨---------------------------------丨\t");
  }

  public static String Input_id(){
    System.out.println("\t丨----Welcome to use login server----丨\t");
    System.out.print("\t丨请输入卡号或输入root进行管理员登录:");

    Scanner sc = new Scanner(System.in);
    String id = sc.nextLine();
    return id;
  }

  public static String Input_pwd(){
    System.out.println("\t丨----Welcome to use login server----丨");
    System.out.print("\t丨请输入密码:");
    Scanner sc = new Scanner(System.in);
    String pwd = sc.nextLine();
    return pwd;
  }

  public static String root_input_pwd(){
    System.out.println("\t丨----Welcome to use root server----\t丨");
    System.out.print("\t丨请输入密码:");
    Scanner sc = new Scanner(System.in);
    String pwd = sc.nextLine();
    return pwd;
  }

  public static int saveMoney(){
    System.out.println("\t丨----Welcome to use savemoney server----丨\t");
    System.out.print("\t丨请输入存钱金额:");
    Scanner sc = new Scanner(System.in);
    int money = sc.nextInt();
    return money;
  }

  public static void saveMoney_ok(int money,int i){
    System.out.println("\t丨----------   Status   -----------丨\t");
    System.out.println("\t丨             OK             丨\t");
    System.out.print("\t丨存入成功，当前余额为:");
    System.out.println(money);
    System.out.println("\t丨---------------------------------丨\t");
  }

  public static int getMoney(){
    System.out.println("\t丨----------   Status   -----------丨\t");
    System.out.println("\t丨Welcome to use withdrawal server 丨\t");
    System.out.print("\t丨请输入取钱金额：");
    Scanner sc = new Scanner(System.in);
    int money = sc.nextInt();
    return money;
  }

  public static void getMoney_ok(int money,int i){
    System.out.println("\t丨----------   Status   -----------丨\t");
    System.out.println("\t丨             OK             丨\t");
    System.out.print("\t丨取出成功，当前余额为:");
    System.out.println("\t"+ money);
    System.out.println("\t丨---------------------------------丨\t");
  }

  public static void showoverage(Account account){
    System.out.println("\t丨--------   Search Sever   --------丨\t");

    System.out.print("\t丨当前账户为:");
    System.out.println("\t"+ account.getCardno());
    System.out.print("\t丨当前余额为:");
    System.out.println("\t"+ account.getMoney());
    System.out.println("\t丨----------------------------------丨\t");
  }

  public static String transfer(){
    System.out.println("\t丨----Welcome to use transfer server----丨\t");
    System.out.println("\t丨----       转账汇款谨防诈骗          ----丨\t");
    System.out.print("\t丨请输入转账对象：");
    Scanner sc = new Scanner(System.in);
    String to = sc.next();
    return to;
  }

  public static int transferMoney(){
    System.out.println("\t丨----Welcome to use transfer server----丨\t");
    System.out.println("\t丨----       转账汇款谨防诈骗          ----丨\t");
    System.out.print("\t丨请输入转账金额：");
    Scanner sc = new Scanner(System.in);
    int money = sc.nextInt();
    return money;
  }

  public static void transferMoney_ok(){
    System.out.println("\t丨----------   Status   -----------丨\t");
    System.out.println("\t丨                OK               丨\t");
    System.out.println("\t丨            转账汇款成功           丨\t");
    System.out.println("\t丨---------------------------------丨\t");
  }

  public static void Printcertificate_get(int money, Account a, String d){
    System.out.println("\t丨----------   Status   -----------丨\t");
    System.out.println("\t丨              OK              \t");
    System.out.println("\t丨          请收好您的凭证        \t");
    System.out.println("\t丨北京时间：" + d);
    System.out.println("\t丨账户："+a.getCardno());
    System.out.println("\t丨操作：取款");
    System.out.println("\t丨金额：" + money);
    System.out.println("\t丨---------------------------------丨\t");
  }

  public static void Printcertificate_save(int money, Account a, String d){
    System.out.println("\t丨----------   Status   -----------丨\t");
    System.out.println("\t丨              OK              \t");
    System.out.println("\t丨          请收好您的凭证        \t");
    System.out.println("\t丨北京时间：" + d);
    System.out.println("\t丨账户："+a.getCardno());
    System.out.println("\t丨操作：存款");
    System.out.println("\t丨金额：" + money);
    System.out.println("\t丨---------------------------------丨\t");
  }

  public static void Printcertificate_transfer(int money, Account a, String d,String to){
    System.out.println("\t丨----------   Status   -----------丨\t");
    System.out.println("\t丨              OK              \t");
    System.out.println("\t丨          请收好您的凭证        \t");
    System.out.println("\t丨北京时间：" + d);
    System.out.println("\t丨账户："+a.getCardno());
    System.out.println("\t丨操作：转账");
    System.out.println("\t丨目标账户："+ to);
    System.out.println("\t丨金额：" + money);
    System.out.println("\t丨---------------------------------丨\t");
  }

  public static void Show_error_input(){
    System.out.println("\t丨----------   Status   -----------丨\t");
    System.out.println("\t丨              Error              丨\t");
    System.out.println("\t丨            您的输入无效           丨\t");
    System.out.println("\t丨---------------------------------丨\t");
  }

  public static void Show_error_Notrans_self(){
    System.out.println("\t丨----------   Status   -----------丨\t");
    System.out.println("\t丨              Error              丨\t");
    System.out.println("\t丨            无法向自己转账         丨\t");
    System.out.println("\t丨---------------------------------丨\t");
  }

  public static void Show_error_NotFoundUser(){
    System.out.println("\t丨----------   Status   -----------丨\t");
    System.out.println("\t丨              Error              丨\t");
    System.out.println("\t丨      找不到该用户，请确认后转账     丨\t");
    System.out.println("\t丨---------------------------------丨\t");
  }

  public static void Show_error_noId(){
    System.out.println("\t丨----------   Status   -----------丨\t");
    System.out.println("\t丨              Error              丨\t");
    System.out.println("\t丨         您输入的卡号不存在!        丨\t");
    System.out.println("\t丨---------------------------------丨\t");
  }

  public static void Show_error_Nomoney(){
    System.out.println("\t丨----------   Status   -----------丨\t");
    System.out.println("\t丨              Error              丨\t");
    System.out.println("\t丨         您的账户余额不足!          丨\t");
    System.out.println("\t丨---------------------------------丨\t");
  }

  public static void Show_error_freeze(){
    System.out.println("\t丨----------   Status   -----------丨\t");
    System.out.println("\t丨              Error              丨\t");
    System.out.println("\t丨            账户已被冻结!          丨\t");
    System.out.println("\t丨---------------------------------丨\t");
  }

  public static String Show_error_pwd(){
    System.out.println("\t丨---------------------------------丨\t");
    System.out.println("\t丨              Error              丨\t");
    System.out.println("\t丨      您输入的密码错误，请重新输入!   丨\t");
    System.out.print("\t请输入密码:");
    Scanner sc = new Scanner(System.in);
    String pwd = sc.nextLine();
    return pwd;
  }

  public static int root_options() {
    Scanner sc = new Scanner(System.in);
    System.out.println("\t丨----Welcome to use root server----丨\t");
    System.out.println("\t丨选择所需业务:                       丨\t");
    System.out.println("\t丨 1.jpg、新增用户       5、退出           丨\t");
    System.out.println("\t丨 2、删除用户                        丨\t");
    System.out.println("\t丨 3、修改用户                        丨\t");
    System.out.println("\t丨 4、查询用户                        丨\t");
    System.out.println("\t丨----------------------------------丨\t");
    int operate = sc.nextInt();
    return operate;
  }

  public static String create_userID(){
    System.out.println("\t丨----Welcome to use create server----丨");
    System.out.print("\t丨请输入新用户名:");
    Scanner sc = new Scanner(System.in);
    String userID = sc.nextLine();
    return userID;
  }

  public static String delete_user(){
    System.out.println("\t丨----Welcome to use delete server----丨");
    System.out.print("\t丨请输入要删除用户ID:");
    Scanner sc = new Scanner(System.in);
    String userID = sc.nextLine();
    return userID;
  }

  public static String create_userPWD(){
    System.out.println("\t丨----Welcome to use create server----丨");
    System.out.print("\t丨请输入新用户密码:");
    Scanner sc = new Scanner(System.in);
    String userPWD = sc.nextLine();
    return userPWD;
  }

  public static void create_userOK(){
  System.out.println("\t丨----------   Status   -----------丨\t");
  System.out.println("\t丨               OK                丨\t");
  System.out.println("\t丨             开户成功!            丨\t");
  System.out.println("\t丨---------------------------------丨\t");
}


  public static void delete_user_ok(){
    System.out.println("\t丨----------   Status   -----------丨\t");
    System.out.println("\t丨                OK               丨\t");
    System.out.println("\t丨            删除账户成功           丨\t");
    System.out.println("\t丨---------------------------------丨\t");
  }
  public static void change_user_ok(){
    System.out.println("\t丨----------   Status   -----------丨\t");
    System.out.println("\t丨                OK               丨\t");
    System.out.println("\t丨            更改账户成功           丨\t");
    System.out.println("\t丨---------------------------------丨\t");
  }

  public static String change_user_bf(){
    System.out.println("\t丨----Welcome to use login server----丨\t");
    System.out.print("\t丨请输入要修改的卡号:");
    Scanner sc = new Scanner(System.in);
    String id = sc.nextLine();
    return id;
  }
  public static String change_user_af(){
    System.out.println("\t丨----Welcome to use login server----丨\t");
    System.out.print("\t丨请输入新的卡号:");
    Scanner sc = new Scanner(System.in);
    String id = sc.nextLine();
    return id;
  }


  public static void show_all_user(Account[] a){
    System.out.println(Arrays.toString(a));
  }

}
